import request from '@/utils/request'

// 查询客户等级列表
export function listLevel(query) {
  return request({
    url: '/prod-api/customer/level/list',
    method: 'get',
    params: query
  })
}


export function listSelect(query) {
  return request({
    url: '/prod-api/customer/level/listSelect',
    method: 'get',
    params: query
  })
}


// 查询客户等级详细
export function getLevel(levelId) {
  return request({
    url: '/prod-api/customer/level/' + levelId,
    method: 'get'
  })
}


export function getLevelByid(levelId) {
  return request({
    url: '/prod-api/customer/level/getLevel',
    method: 'get',
    params: {levelId:levelId}
  })
}


// 新增客户等级
export function addLevel(data) {
  return request({
    url: '/prod-api/customer/level',
    method: 'post',
    data: data
  })
}

// 修改客户等级
export function updateLevel(data) {
  return request({
    url: '/prod-api/customer/level',
    method: 'put',
    data: data
  })
}

// 删除客户等级
export function delLevel(levelId) {
  return request({
    url: '/prod-api/customer/level/' + levelId,
    method: 'delete'
  })
}

// 查询客户免费等级列表
export function getLevelInfo(query) {
  return request({
    url: '/prod-api/customer/level/levelInfolist',
    method: 'get',
    params: query
  })
}

// 查询VIP等级列表
export function memberLevelList(query) {
  return request({
    url: '/prod-api/customer/level/memberLevelList',
    method: 'get',
    params: query
  })
}
// 修改客户等级
export function UpdateStartStatus(data) {
  return request({
    url: '/prod-api/customer/level/UpdateStartStatus',
    method: 'put',
    data: data
  })
}

// 查询客户付费等级列表
export function getPayLevelInfo(query) {
  return request({
    url: '/prod-api/customer/level/PaylevelInfolist',
    method: 'get',
    params: query
  })
}

//查询详细客户等级信息
export function levelInfoDetail(levelId) {
  return request({
    url: '/prod-api/customer/level/levelInfoDetail/' + levelId,
    method: 'get'
  })
}

// 新增客户等级以及权益信息
export function saveLevelPrivileageInfo(data) {
  return request({
    url: '/prod-api/customer/level/saveLevelPrivileageInfo',
    method: 'post',
    data: data
  })
}

// 修改客户等级以及权益信息
export function UpdateLevelPrivileageInfo(data) {
  return request({
    url: '/prod-api/customer/level/UpdateLevelPrivileageInfo',
    method: 'post',
    data: data
  })
}

//权益信息
export function PrivileageInfo() {
  return request({
    url: '/prod-api/customer/level/levelPrivileageInfo',
    method: 'get'
  })
}

//查询所有付费等级列表
export function getPayLevel() {
  return request({
    url: '/prod-api/customer/level/getPayLevelInfo',
    method: 'get'
  })
}
